{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "",
   "id": "4fbaf4e2fda497af"
  },
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-02-27T02:27:21.402628Z",
     "start_time": "2025-02-27T02:27:21.372548Z"
    }
   },
   "source": [
    "#有一点点小问题。。。\n",
    "from pyecharts.charts import Map\n",
    "from pyecharts.options import VisualMapOpts\n",
    "map=Map()\n",
    "data=[\n",
    "    (\"北京\",99),\n",
    "    (\"上海\",199),\n",
    "    (\"湖南\",299),\n",
    "    (\"台湾\",199),\n",
    "    (\"安徽\",299),\n",
    "    (\"广州\",399),\n",
    "    (\"湖北\",599)\n",
    "]\n",
    "map.add(\"地图\",data,\"china\")\n",
    "map.set_global_opts(\n",
    "    visualmap_opts=VisualMapOpts(\n",
    "        is_show=True,\n",
    "        is_piecewise=True,\n",
    "        pieces=[\n",
    "            {\"min\":1,\"max\":9,\"label\":\"1-9人\",\"color\":\"#CCFFFF\"},\n",
    "            {\"min\":10,\"max\":99,\"label\":\"10-99人\",\"color\":\"#FFFF99\"},\n",
    "            {\"min\":100,\"max\":499,\"label\":\"99-499人\",\"color\":\"#FF9966\"},\n",
    "            {\"min\":500,\"max\":999,\"label\":\"499-999人\",\"color\":\"#CC3333\"},\n",
    "          \n",
    "        ]\n",
    "    )\n",
    ")\n",
    "map.render()"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\python\\\\code\\\\TestCode\\\\Python-learn\\\\Python基础综合案例\\\\render.html'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 7
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
